package com.ww.learn.funs

// 可变参数列表，numbers的实际类型维数组，vararg将参数注释为指定类型的数组
fun max(vararg numbers: Int): Int {
    var large = Int.MIN_VALUE

    for (number in numbers) {
        large = if (number > large) number else large
    }
    return large
}

fun main() {
    println(max(1, 5, 2))
    println(max(1, 5, 2, 12, 7, 3))
}